import request from '@/config/axios'

// 雇主咨询单 VO
export interface AdvisoryServiceOrderVO {
  id: number // 咨询单ID
  employerId: number // 雇主ID
  employerNickName: string // 雇主昵称
  advisoryId: number // 咨询ID
  wokerId: number // 自由职业者ID
  wokerNickName: string // 自由职业者昵称
  title: string // 咨询名称
  description: string // 咨询描述
  duration: number // 咨询时长
  amount: number // 金额
  status: number // 订单状态
  scheduleType: number // 行程安排
  bookTime: Date // 预约时间
}

// 雇主咨询单 API
export const AdvisoryServiceOrderApi = {
  // 查询雇主咨询单分页
  getAdvisoryServiceOrderPage: async (params: any) => {
    return await request.get({ url: `/xinyu/advisory-service-order/page`, params })
  },

  // 查询雇主咨询单详情
  getAdvisoryServiceOrder: async (id: number) => {
    return await request.get({ url: `/xinyu/advisory-service-order/get?id=` + id })
  },

  // 新增雇主咨询单
  createAdvisoryServiceOrder: async (data: AdvisoryServiceOrderVO) => {
    return await request.post({ url: `/xinyu/advisory-service-order/create`, data })
  },

  // 修改雇主咨询单
  updateAdvisoryServiceOrder: async (data: AdvisoryServiceOrderVO) => {
    return await request.put({ url: `/xinyu/advisory-service-order/update`, data })
  },

  // 删除雇主咨询单
  deleteAdvisoryServiceOrder: async (id: number) => {
    return await request.delete({ url: `/xinyu/advisory-service-order/delete?id=` + id })
  },

  // 导出雇主咨询单 Excel
  exportAdvisoryServiceOrder: async (params) => {
    return await request.download({ url: `/xinyu/advisory-service-order/export-excel`, params })
  },
}